home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Linux Cubed Series 8: LINUX Games
/
Linux Cubed Series 8 - LINUX Games.iso
/
games
/
video
/
thrust-s.53
/
thrust-s
/
thrust
/
datasrc
/
reverse.c
< prev
next >
Wrap
C/C++ Source or Header
|
1995-10-13
|
536b
|
34 lines
/* Written by Peter Ekberg, peda@lysator.liu.se */
#include <stdio.h>
#include <stdlib.h>
int main(int argc,char *argv[])
{
long j;
int i;
char ch;
int r;
if(argc>2) {
fprintf(stderr, "%s: Usage %s [number]\n",argv[0],argv[0]);
exit(1);
}
r=atoi(argv[1]);
if(fseek(stdin,0L,SEEK_END))
perror(argv[0]);
for(j=ftell(stdin)/r-1; j>=0; j--) {
if(fseek(stdin,j*r,SEEK_SET))
perror(argv[0]);
for(i=0; i<r; i++) {
ch=fgetc(stdin);
fputc(ch,stdout);
}
}
return(0);
}